import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description: 实现一个方法 transform, 以数组为参数, 循环将数组中的每个元素 乘以 2 , 并设置到对应的数组元素上.
 *              例如 原数组为 {1, 2, 3}, 修改之后为 {2, 4, 6}
 * User: 15085202591
 * Date: 2022-11-05
 * Time: 9:45
 */
public class TransformArray {
    public static void transform(int[] array){
        for (int i = 0; i < array.length; i++) {
            array[i] *= 2;
        }
    }
    public static void main(String[] args) {
        int[] array = new int[]{1,2,3,4};
        System.out.println(Arrays.toString(array));
        transform(array);
        System.out.println(Arrays.toString(array));
    }
}
